package com.xyht.medicine_management_system.modules.payment.alipay.controller;

import com.xyht.medicine_management_system.common.annotation.RequestPass;
import com.xyht.medicine_management_system.modules.payment.alipay.service.AliService;
import com.xyht.medicine_management_system.modules.payment.wxpay.entity.CallbackBodyEntity;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;

@RestController
@RequestMapping("/alipay")
public class AliController {

    @Resource
    private AliService aliService;

    @PostMapping("/payCallback")
    @RequestPass
    @ApiModelProperty("支付宝支付回调接口")
    public String wxPayCallback(HttpServletRequest request, HttpServletResponse response) {
        return aliService.aliPayCallback(request,response);
    }

    @PostMapping("/profitSharing")
    @RequestPass
    @ApiModelProperty("支付宝分账回调接口")
    public String aliPayProfitSharingCallback(HttpServletRequest request, HttpServletResponse response) {
        return aliService.aliPayProfitSharingCallback(request,response);
    }
}
